<?php
error_reporting(E_ALL);

$relPath="./pinc/";
require_once $relPath."dpinit.php";
include_once($relPath.'dp_main.inc');

$User->IsSiteManager() or die("Not permitted");

$activity = _("Activity");

dp_header($activity);

say("<h1>Activity Report</h1>
<div class='lfloat w50'>
<h2>One Day</h2>
<h3>Users</h3>
");

$tbl  = new DpTable();
$tbl->AddColumn("<User", "username");
$tbl->AddColumn(">Pages saved", "ecount");
$rows = $dpdb->SqlRows("CALL user_activity_for_days(1)");
$tbl->SetRows($rows);
$tbl->EchoTable();

say("<h3>Projects</h3>
");
$tbl = new DpTable();
$tbl->AddColumn("^Project id", "projectid");
$tbl->AddColumn("<Title", "nameofwork");
$tbl->AddColumn(">Pages saved", "ecount");
$rows = $dpdb->SqlRows("CALL project_activity_for_days(1)");
$tbl->SetRows($rows);
$tbl->EchoTable();

say("</div>
<div class='lfloat w50'>
<h2>Two Days</h2>
<h3>Users</h3>
");

$tbl  = new DpTable();
$tbl->AddColumn("<User", "username");
$tbl->AddColumn(">Pages saved", "ecount");
$rows = $dpdb->SqlRows("CALL user_activity_for_days(2)");
$tbl->SetRows($rows);
$tbl->EchoTable();

say("<h3>Projects</h3>
");
$tbl = new DpTable();
$tbl->AddColumn("^Project id", "projectid");
$tbl->AddColumn("<Title", "nameofwork");
$tbl->AddColumn(">Pages saved", "ecount");
$rows = $dpdb->SqlRows("CALL project_activity_for_days(2)");
$tbl->SetRows($rows);
$tbl->EchoTable();

say("</div>\n");

dp_footer();
// vim: sw=4 ts=4 expandtab
?>
